package org.fuys.coder.domain.auth.service.handler.login.impl;

import org.fuys.coder.common.entity.Pair;
import org.fuys.coder.common.exception.BusinessException;
import org.fuys.coder.domain.auth.model.req.LoginReq;
import org.fuys.coder.domain.auth.model.vo.UserVo;
import org.fuys.coder.domain.auth.service.common.login.ICommonLoginRepoService;
import org.fuys.coder.domain.auth.service.handler.login.LoginHandler;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @projectName: fuys-low-coder
 * @package: org.fuys.coder.domain.auth.service.handler.login.impl
 * @className: InfoGetHandler
 * @author: WangJing
 * @description: 最后的处理器 一定要注意顺序!!!
 * @date: 2024/8/9 17:38
 * @version: 1.0
 */

@Component
public class InfoGetHandler implements LoginHandler {
    @Resource
    private ICommonLoginRepoService commonLoginRepoService;


    @Override
    public Pair<Integer, UserVo> handle(LoginReq req) throws BusinessException {
        return commonLoginRepoService.login(req);
    }
}
